<template>
	<view class="content">
		<view class="header">
			<view class="box">
				<text class="iconfont icon-left" @click="go()"></text>
				<text class="title">余额</text>
			</view>
		</view>
		<view class="boxx">
			<text class="name">金盾</text>
			<text class="f">{{userAccount}}</text>
			<view @click="shows()">充值</view>
		</view>
		<view class="table">
			<text class="title">明细查询</text>
			<view class="th">
				<text>时间</text>
				<text>内容</text>
				<text>金盾</text>
			</view>
			<view class="td" v-for="record in records">
				<text>{{record.create_time}}</text>
				<text>{{record.type}}</text>
				<text>{{record.num}}</text>
			</view>
			<view class="nulls" v-if="records.length = 0">
				<text class="iconfont icon-order"></text>
				<text class="f">暂无明细～～</text>
			</view>
		</view>
		<wyb-popup ref="popup" type="center" width='715' height="500" radius="6">
		    <view class="boxsa">
		    	<text class="title">请输入您要充值的金额</text>
		    	<view class="changes">
		    		<input type="text" value="" />
		    		<text class="pcs">元</text>
		    	</view>
		    	<view class="btn" @click="link('/pages/querendingdan/querendingdan')">确定</view>
		    	<text class="fs">限时优惠价</text>
		    	<view class="list">
		    		<text>100元=200金盾</text>
		    		<text>300元=600金盾</text>
		    		<text>500元=1000金盾</text>
		    	</view>
		    </view>
		</wyb-popup>
			
	</view>
</template>

<script>
	import wybPopup from '@/components/wyb-popup/wyb-popup.vue'
	export default {
		components: {
		        wybPopup
		    },
		data() {
			return {
				 show:false,
				 records:[],
				 userAccount:0,
			}
		},
		onLoad() {
			this.getData();
		},
		methods: {
			link(n) {
				uni.navigateTo({
					url: n,
					animationType: 'pop-in',
					animationDuration: 200
				})
			},
			shows(){
				this.$refs.popup.show()
			},
			hide(){
				this.$refs.popup.hide()
			},
			go(){
				uni.navigateBack({
					delta:1
				})
			},
			getData(){
				let self = this;
				self._get('user/account',{},function(res){
					self.userAccount = res.data.account;
				});
				self._get('user/accountReward',{},function(res){
					console.log(res);
					self.records = res.data.data;
				});
			}
		}
	}
</script>

<style lang="scss">
	view,
	text,
	input,
	textarea {
		box-sizing: border-box;
	}
	
	page{
		background: #fff;
	}
	.fs{
		display: block;
		text-align: center;
		font-size: 26rpx;
		color: #FA6400;
		margin-top: 35rpx;
		font-weight: bold;
	}
	.list{
		overflow: hidden;
		text{
			display: block;
			width: 33.33%;
			float: left;
			text-align: center;
			font-size: 23rpx;
			margin-top: 15rpx;
			color: #F78200;
		}
	}
		.boxsa{
			overflow: hidden;
			width: 715rpx;
			background: #fff;
			border-radius: 10rpx;
			padding: 42rpx 0;
			.btn{
				width: 230rpx;
				height: 82rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				margin: 0 auto;
				font-size: 38rpx;
				margin-top: 45rpx;
				border-radius: 40rpx;
				color: #0091FF;
				border: 2px solid #0091FF;
				background: #FCFCFC;
			}
			.title{
				display: block;
				font-size: 28rpx;
				color: #2D2D2D;
				text-align: center;
				line-height: 35rpx;
			}
			.changes{
				overflow: hidden;
				display: flex;
				align-items: center;
				justify-content: center;
				height: 80rpx;
				position: relative;
				margin: 0 auto;
				margin-top: 50rpx;
				width: 250rpx;
				border-bottom: 2px solid #0091FF;
				input{
					width: 100%;
					height: 100%;
					border: none;
					outline: none;
					color: #0091FF;
					font-size: 30rpx;
				}
				text{
					color: #2D2D2D;
					font-size: 25rpx;
					position: absolute;
					right: 0;
					top: 0;
					line-height: 80rpx;
				}
			}
		}
	uni-picker{
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		.uni-input{
			font-size: 24rpx;
		}
	}
	.nulls{
		overflow: hidden;
		image{
			display: block;
			margin: 0 auto;
		}
		.iconfont{
			font-size: 160rpx;
			display: block;
			color: #E1E1E1;
			margin-bottom: 38rpx;
			margin-top: 100rpx;
			text-align: center;
		}
		.f{
			display: block;
			font-size: 30rpx;
			color: #D8D8D8;
			text-align: center;
		}
	}
	.table{
		overflow: hidden;
		width: 100%;
		.title{
			display: block;
			font-size: 28rpx;
			color: #153B33;
			text-align: center;
			line-height: 70rpx;
			background: #F3F3F3;
		}
		.th{
			display: flex;
			align-items: center;
			height: 70rpx;
			justify-content: space-around;
			background: #C2CCCA;
			text{
				font-size: 24rpx;
				color: #153B33;
				display: block;
				width: 200rpx;
				text-align: center;
			}
		}
		.td{
			display: flex;
			align-items: center;
			height: 70rpx;
			border-bottom: 1px solid #CECECE;
			justify-content: space-around;
			text{
				font-size: 22rpx;
				color: #2D2D2D;
				display: block;
				width: 200rpx;
				text-align: center;
			}
		}
	}
	.boxx{
		overflow: hidden;
		width: 692rpx;
		height: 397rpx;
		background: linear-gradient(#1C4F44, #153B33);
		display: flex;
		align-items: center;
		margin: 48rpx auto 38rpx;
		border-radius: 15rpx;
		position: relative;
		justify-content: center;
		.f{
			font-size: 100rpx;
			font-weight: 300;
			color: #fff;
			line-height: 1;
		}
		.name{
			font-size: 38rpx;
			color: #fff;
			position: absolute;
			left: 45rpx;
			top: 38rpx;
		}
		view{
			width: 113rpx;
			height: 45rpx;
			border-radius: 40rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 25rpx;
			background: #DBAC53;
			color: #fff;
			position: absolute;
			right: 48rpx;
			bottom: 48rpx;
		}
	}
	
	.content{
		overflow: hidden;
		width: 100%;
		position: relative;
		height: 100vh;
		.header{
			overflow: hidden;
			width: 100%;
			background-image: url(../../static/fawu_06.jpg);
			background-size: 100% 33rpx;
			background-repeat: no-repeat;
			background-position: bottom center;
			height: 155rpx;
			background-color: #153B33;
			position: relative;
			padding: 60rpx 0 0 0;
			.box{
				overflow: hidden;
				width: 100%;
				display: flex;
				position: relative;
				align-items: center;
				justify-content: center;
				.title {
					font-size: 28rpx;
					color: #DBAC53;
				}
				.icon-shezhi{
					position: absolute;
					right: 17rpx;
					top: 50%;
					font-size: 30rpx;
					transform: translateY(-50%);
				}
				.icon-left{
					color: #DBAC53;
					position: absolute;
					left: 17rpx;
					font-size: 35rpx;
					top: 50%;
					transform: translateY(-50%);
				}
			}
		}
	}
</style>
